package com.mp.approvalreq.dao;

import com.mp.approvalreq.entity.*;
import com.mp.approvalreq.entity.po.ComponentGroup;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

public interface TransferDao {

    /**
     * 批量获取所有请假/补假审批流
     *
     * @param companyId
     * @return
     * @throws SQLException
     */
    List<Leave> selectAllLeaveRequestFlow(Integer companyId) throws SQLException;

    /**
     * 根据审批id获取组件集合
     *
     * @param requestIds
     * @return
     * @throws SQLException
     */
    Map<Integer, List<TemplateComponent>> selectAllComponentByRequestIds(String requestIds) throws SQLException;

    /**
     * 根据审批id查询所有请假明细集合
     *
     * @param requestIds
     * @return
     * @throws SQLException
     */
    Map<Integer, String> selectAllLeaveTime(String requestIds) throws SQLException;

    /**
     * 批量插入假期套件信息
     *
     * @param leaves
     * @throws SQLException
     */
    void insertBatchLeaves(List<Leave> leaves) throws SQLException;

    /**
     * 查询所有审批流信息
     *
     * @param companyId
     * @return
     * @throws SQLException
     */
    List<Request> selectAllFlows(Integer companyId) throws SQLException;

    /**
     * 查看已存在的审批id
     *
     * @param companyId
     * @return
     * @throws SQLException
     */
    List<Integer> selectExistFlowRequestIds(Integer companyId) throws SQLException;

    /**
     * 插入审批流信息
     *
     * @param flows
     * @throws SQLException
     */
    void insertFlows(List<Flow> flows) throws SQLException;

    /**
     * 插入参与人信息
     *
     * @param participants
     * @throws SQLException
     */
    void insertBatchParticipants(List<Participant> participants) throws SQLException;

    /**
     * 批量获取外出/出差审批流
     *
     * @param companyId
     * @return
     * @throws SQLException
     */
    List<Outdoor> selectAllOutdoorRequestFlow(Integer companyId) throws SQLException;

    /**
     * 获取公司模版集合
     *
     * @param companyId
     * @return
     * @throws SQLException
     */
    Map<Integer, Template> selectAllTemplateMap(Integer companyId) throws SQLException;

    /**
     * 批量插入外出/出差套件
     *
     * @param outdoors
     * @throws SQLException
     */
    void insertBatchOutdoors(List<Outdoor> outdoors) throws SQLException;

    /**
     * 获取已存在的外出id
     *
     * @param companyId
     * @return
     * @throws SQLException
     */
    List<Integer> selectExistOutdoorRequestIds(Integer companyId) throws SQLException;

    List<AppendSign> selectAllAppendSignRequestFlow(Integer companyId) throws SQLException;

    List<Integer> selectAllAppendSignRequestIds(Integer companyId) throws SQLException;

    void insertBatchAppendSign(List<AppendSign> appendSigns) throws SQLException;

    List<Overtime> selectAllOvertimes(Integer companyId) throws SQLException;

    List<Integer> selectExistOvertimeRequestIds(Integer companyId) throws SQLException;

    void insertBatchOvertimes(List<Overtime> overtimes) throws SQLException;

    List<Integer> selectExistLeaveRequestIds(Integer companyId) throws SQLException;

    void clearReadPoint() throws SQLException;

    List<Cc> selectAllCcTemp(String requestIds) throws SQLException;

    List<Cc> selectAllCc(Integer companyId) throws SQLException;

    void updateCc(List<Cc> ccList) throws SQLException;

    void clearCcTime(Integer companyId) throws SQLException;

    List<TemplateComponent> selectAllGroupContent() throws SQLException;

    Map<Integer, Template> selectTemplates(String templateIds) throws SQLException;

    List<Request> selectAllExpenses(Integer companyId) throws SQLException;

    void insertBatchExpenses(List<Expense> expenses) throws SQLException;

    List<Request> selectAllExpenses2(Integer companyId) throws SQLException;

    List<Integer> selectAllRequestIdsByCompanyId(Integer companyId) throws SQLException;

    void updateComponentCompanyId(Integer companyId, List<Integer> requestIds) throws SQLException;

    void updateReqPointCompanyId(Integer companyId, List<Integer> requestIds) throws SQLException;

    List<Template> selectAllTemplateByType(Integer companyId) throws SQLException;

    void updateBatchTemplate(List<Template> dataToUpdate) throws SQLException;

    List<Request> selectAllDaysOffRequest(Integer companyId) throws SQLException;

    List<Integer> selectExistExpense(Integer companyId) throws SQLException;

    void updateBatchExpenseType() throws SQLException;

    Map<Integer, List<TemplateComponent>> selectAllComponents(Integer companyId) throws SQLException;

    List<Request> selectAllRequestByType(Integer companyId) throws SQLException;

    void insertMoneys(List<Money> list) throws SQLException;

    Map<Integer, Map<Integer, List<GroupContent>>> selectGroupComponent(Integer companyId) throws SQLException;

    List<GroupContent> selectAllGroupContentValue(Integer companyId) throws SQLException;

    List<ComponentGroup> selectAllGroup(Integer companyId) throws SQLException;

    void updateGroupContentValue(List<GroupContent> values) throws SQLException;
}